import { createSlice } from "@reduxjs/toolkit"
export const slice = createSlice({
    name: "drawer",
    initialState: {
        flag: false,
        active: null,
    },
    reducers: {
        switchFlag: (state, action) => {
            state.flag = action.payload
        },
        setActive: (state, action) => {
            state.active = action.payload
        },
    },
})

export const { switchFlag, setActive } = slice.actions
export default slice.reducer
